//
//  FindCarViewController.m
//  B段项目
//
//  Created by dllo on 15/9/29.
//  Copyright (c) 2015年 昶博. All rights reserved.
//

#import "FindCarViewController.h"
#import "PrefixHeader.pch"
#import "FindCarView.h"
#import "FindCarTableView.h"
#import "FIndCarDetailVC.h"

@interface FindCarViewController ()

@property (nonatomic, strong) FindCarView *barView;

@end

@implementation FindCarViewController

- (void)viewWillAppear:(BOOL)animated
{
    SelfNavBar.hidden = YES;
    SelfTabBar.hidden = NO;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    [self barViewSubView];
    [self tableViewSubviews];
    
    NSNotificationCenter *center =[ NSNotificationCenter defaultCenter];
    [center addObserver:self selector:@selector(pass:) name:@"pass" object:nil];
}

#pragma mark --上部自定义view
- (void)barViewSubView
{
    self.barView = [[FindCarView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth * 375 / 375, ScreenHeight * 100 / 667)];
    
    self.barView.backgroundColor = RGB(22, 188, 180);
    [self.view addSubview:self.barView];
}

- (void)tableViewSubviews
{
    FindCarTableView *tableView = [[FindCarTableView alloc] initWithFrame:CGRectMake(0, ScreenHeight * 100 / 667, ScreenWidth, ScreenHeight - ScreenHeight * 150 / 667) style:UITableViewStylePlain];
    [self.view addSubview:tableView];
}

- (void)pass:(NSNotification *)noti
{
    FIndCarDetailVC *details = [[FIndCarDetailVC alloc] init];
    details.webLink = noti.object;
   [self.navigationController pushViewController:details animated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
